![]() |
PATH![]() |
![]() ![]() |
Applies a theme-compliant color or pattern to the background of the current port.
pascal OSStatus SetThemeBackground (
ThemeBrush inBrush,
SInt16 inDepth,
Boolean inIsColorDevice);
Your application should call the SetThemeBackground function each time you wish to draw in a specified brush type. Note that the SetThemeBackground function aligns patterns with 0,0 in the current port. To align a pattern independently of the port origin, use the function ApplyThemeBackground .
Because the constant in the inBrush parameter can specify a color or pattern, depending on the current theme, your application must save and restore the current drawing state of the graphics port around calls to SetThemeBackground . Under Appearance Manager 1.1 and later, you can use the functions GetThemeDrawingState and SetThemeDrawingState to do this.
Prior to Appearance Manager 1.1, you must save and restore the pnPixPat and bkPixPat fields of your graphics port when saving the text and background colors. Because patterns in the bkPixPat field override the background color of the window, call the QuickDraw function BackPat to set your background pattern to a normal white pattern. This ensures that you can use RGBBackColor to set your background color to white, call the QuickDraw function EraseRect , and get the expected results.